home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM25_C.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  4KB  |  85 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM25_C.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_mappable_region_count                               ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function gets the number of entries which will be  ;
  7. ;                     required for the array of structures the                ;
  8. ;                     get_mappable_regions function returns.  Note that       ;
  9. ;                     this function does not actually return the array but    ;
  10. ;                     merely a count of the entries in the array returned     ;
  11. ;                     by the get_mappable_regions function.  This number also ;
  12. ;                     represents the total number of mappable memory pages in ;
  13. ;                     the system.                                             ;
  14. ;                                                                             ;
  15. ;           PASSED:   &mr_count:                                              ;
  16. ;                        is a far pointer to a count of the number of entries ;
  17. ;                        in the array of structures that are returned by the  ;
  18. ;                        get_mappable_regions function.                       ;
  19. ;                                                                             ;
  20. ;         RETURNED:   status:                                                 ;
  21. ;                        is the status EMM returns from the call.  All other  ;
  22. ;                        returned results are valid only if the status        ;
  23. ;                        returned is zero.  Otherwise they are undefined.     ;
  24. ;                                                                             ;
  25. ;                     mr_count:                                               ;
  26. ;                        is a count of the number of entries in the mr        ;
  27. ;                        array of structures returned by the                  ;
  28. ;                        get_mappable_regions function.                       ;
  29. ;                                                                             ;
  30. ; C USE CONVENTION:   unsigned int status;                                    ;
  31. ;                     unsigned int mr_count;                                  ;
  32. ;                                                                             ;
  33. ;                     status = get_mappable_region_count (&mr_count);         ;
  34. ;-----------------------------------------------------------------------------;
  35. .XLIST
  36. PAGE    60,132
  37.  
  38. IFDEF SMALL
  39.    .MODEL SMALL, C
  40. ENDIF
  41. IFDEF MEDIUM
  42.    .MODEL MEDIUM, C
  43. ENDIF
  44. IFDEF LARGE
  45.    .MODEL LARGE, C
  46. ENDIF
  47. IFDEF COMPACT
  48.    .MODEL COMPACT, C
  49. ENDIF
  50. IFDEF HUGE
  51.    .MODEL HUGE, C
  52. ENDIF
  53.  
  54. INCLUDE emmlib.equ
  55. INCLUDE emmlib.str
  56. INCLUDE emmlib.mac
  57. .LIST
  58. .CODE
  59.  
  60. get_mappable_region_count    PROC                                          \
  61.                 ptr_mappable_region_count:FAR PTR WORD
  62.  
  63.     ;---------------------------------------------------------------------;
  64.     ;   do;                                                               ;
  65.     ;   .   get the mappable region count from EMM;                       ;
  66.     ;---------------------------------------------------------------------;
  67.     MOVE        AX, get_mappable_array_entries_fcn
  68.     INT         EMM_int
  69.  
  70.     ;---------------------------------------------------------------------;
  71.     ;   .   pass the mappable region count back to the caller;            ;
  72.     ;---------------------------------------------------------------------;
  73.     MOVE        ES:BX, ptr_mappable_region_count
  74.     MOVE        ES:[BX], CX
  75.  
  76.     ;---------------------------------------------------------------------;
  77.     ;   .   return (EMM status);                                          ;
  78.     ;   end;                                                              ;
  79.     ;---------------------------------------------------------------------;
  80.     RET_EMM_STAT    AH
  81.  
  82. get_mappable_region_count    ENDP
  83.  
  84. END
  85.